package git.soulbgm.common;

import io.netty.channel.Channel;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2018-06-04 19:35
 * @description 维护TCP连接的Map
 */
public class TcpConnectMap {

    private final static ConcurrentHashMap<String, Channel> connectMap = new ConcurrentHashMap<>();

    public static ConcurrentHashMap<String, Channel> getConnectMap() {
        return connectMap;
    }

    public static void put(String key, Channel channel) {
        connectMap.put(key, channel);
    }

    public static Channel get(String key) {
        return connectMap.get(key);
    }

    public static void remove(String key) {
        connectMap.remove(key);
    }
}
